<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <input type="text" class="text" placeholder="请输入密码" />
    <button type="button">按钮</button>
    <input type="checkbox" class="checkbox" />
    <input type="radio" class="radio" />

    <script>
      window.onload = function () {
        const text = document.querySelector(".text");
        console.log(text.value);
        // 修改表单的值
        text.value = "我的密码是哈哈哈哈";

        // 表单禁用
        text.disabled = true;
        const button = document.querySelector("button");
        button.disabled = true;

        // 默认选中状态
        const checkbox = document.querySelector(".checkbox");
        checkbox.checked = true;

        // 默认选中状态
        const radio = document.querySelector(".radio");
        radio.checked = true;
      };
    </script>
  </body>
</html>
